import dearpygui.dearpygui as dpg

dpg.create_context()

def call_back(sender):
    print(dpg.get_item_label(sender),"'s value",dpg.get_value(sender))

with dpg.window(width=300):
    # Creating a slider_int widget and setting the
    # default value to 15.
    dpg.add_slider_int(default_value=15,label="slider_int", tag="slider_int", callback=call_back)

# On second thought, we're gonna set the value to 40
# instead - for no reason in particular...
dpg.set_value("slider_int", 40)

dpg.create_viewport(title='Custom Title', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()